//////////////////////////////////////////////////////////////////////////
//					Character Animation with Direct3D					//
//						   Author: C. Granberg							//
//							   2008 - 2009								//
//////////////////////////////////////////////////////////////////////////

#ifndef PHYSICS_NJIN
#define PHYSICS_NJIN

#include "Game Engine\Header\d3dUtil.h"
#include "Game Engine\Header\BulletUtil.h"
#include "Game Engine\Header\Mesh.h"

using namespace std;

class Physics
{
public:
	Physics();
	~Physics();

	void				Init();

	enum Shape
	{
		Capsule,
		Cube,
		Cyl,
		Plane,
		Sph,
		TriMesh
	};

	enum Axis
	{
		X,
		Y,
		Z
	};

protected:
	btRigidBody*		CreateRigidBodyGeneric( btDynamicsWorld* world, Mesh* mesh, float mass,
							Shape shape = Cube );
	btRigidBody*		CreateRigidBody( btDynamicsWorld* world, float mass,
							const btTransform& startTransform, btCollisionShape* shape );

	btPairCachingGhostObject*	CreateGhostObject( btDynamicsWorld* world, Mesh* mesh, float mass,
									Shape shape );
	btPairCachingGhostObject*	CreateGhostObject( btDynamicsWorld* world, float mass,
									const btTransform& startTransform, btCollisionShape* shape );

protected:
	btScalar			mDefaultContactProcessingThreshold;

};

#endif